package com.example.birdfriends.dao;

import com.example.birdfriends.pojo.hot.HotPost;
import com.example.birdfriends.pojo.post.Post;
import javafx.geometry.Pos;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PostDao {
    public int insertPost(Post post);
    public Long findUidByPid(Long pid);
    public Post findPostByPid(Long pid);
    public int updatePostByPid(Post post);
    public int deletePostById(Long pid);
    public List<Post> findPostsByUid(Long uid);
    public List<Post> queryPostWithLoginInMain(@Param("uid") Long uid, @Param("start") Long start, @Param("lineNumber") Long lineNumber);  // 查询除当前用户的其他帖子
    public Long countPostsWithLogin(@Param("uid") Long uid);
    public List<Post> queryPostWithLogin(Long uid);
    public List<Post> queryAllPosts(@Param("start") Long start, @Param("lineNumber") Long lineNumber);  // 查询所有帖子
    public int setImagesAndVideos(Post post);
    public List<Post> findPostsByThemeNotLogin(@Param("theme") String theme, @Param("start") Long start, @Param("lineNumber") Long lineNumber);
    public Long countPostByThemeNotLogin(@Param("theme") String theme);
    public List<Post> findPostsByThemeWithLogin(@Param("theme") String theme, @Param("uid") Long uid, @Param("start") Long start, @Param("lineNumber") Long lineNumber);
    public Long countPostByThemeWithLogin(@Param("theme") String theme, @Param("uid") Long uid);
    public List<Post> findPostsByTitleOrContent(@Param("title") String title, @Param("content") String content);
    public Long countPostsNotLogin();
    public List<Long> findPostsIdsOrderByPid();
    public List<Long> findPostIdListWithLogin(@Param("curLoginUid") Long curLoginUid);
    public List<HotPost> findHotPostsTop100();
}
